<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    // 1.如下步骤
    let s1 = "some text";
    let s2 = s1.substring(2);
    console.log(s2)
    /*
        等于
        let s1 = new String("some text");
        let s2 = s1.substring(2);
        s1 = null;
     */

    // 2.另一个例子
    let str = 'some text'
    str.color = 'red'
    console.log(s1.color) // 因为第22行会创建一个临时对象,第23行访问的时候已经销毁了

</script>
</body>
</html>